package step1_homework4_04;

import java.io.Serializable;
import java.util.Objects;

public class User implements Serializable {
    private static final long serialVersionUID = -2749056776334023828L;

    private String username;                  //成员变量: 用户名
    private String pasword;                   //成员变量: 密码

    public User() {
    }

    public User(String username, String pasword) {
        this.username = username;
        this.pasword = pasword;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPasword() {
        return pasword;
    }

    public void setPasword(String pasword) {
        this.pasword = pasword;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return username.equals(user.username) &&
                pasword.equals(user.pasword);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, pasword);
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", pasword='" + pasword + '\'' +
                '}';
    }
}
